package com.group.doctor.controller;


import com.group.commons.annotation.BaseResponse;
import com.group.doctor.entity.Doctor;
import com.group.doctor.entity.DoctorFans;
import com.group.doctor.service.IDoctorFansService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author KAGE
 * @since 2022-06-07
 */
@BaseResponse
@RestController
@RequestMapping("/doctor/fans")
public class DoctorFansController {
    @Resource 
    private IDoctorFansService doctorFansService;

    /**
     * 医生的粉丝
     * @param current 开始的页码
     * @param size 每页能存的数据
     * @param doctor 医生对象
     * @return 医生的粉丝
     */
    @PostMapping("/list/{current}/{size}")
    public List<DoctorFans> list(@PathVariable("current") Integer current, @PathVariable("size") Integer size,@RequestBody Doctor doctor){
        return doctorFansService.list(current, size, doctor.getId());
    }
}
